<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"github.com","root":"/","scheme":"Gemini","version":"7.7.1","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="linux命令这么多我该怎么记-如何查找Linux的命令">
<meta property="og:type" content="article">
<meta property="og:title" content="linux笔记">
<meta property="og:url" content="https://github.com/13850554413/13850554413.github.io/2018/07/05/linux%E7%AE%80%E8%AE%B0/index.html">
<meta property="og:site_name" content="天上人间">
<meta property="og:description" content="linux命令这么多我该怎么记-如何查找Linux的命令">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2018-07-05T07:30:16.000Z">
<meta property="article:modified_time" content="2020-02-18T12:44:30.986Z">
<meta property="article:author" content="小灰灰">
<meta property="article:tag" content="linux">
<meta property="article:tag" content="笔记">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://github.com/13850554413/13850554413.github.io/2018/07/05/linux%E7%AE%80%E8%AE%B0/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true
  };
</script>

  <title>linux笔记 | 天上人间</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">天上人间</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
        <p class="site-subtitle">个人博客| 学习交流| 日志心态</p>
  </div>

  <div class="site-nav-right"></div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>

  </li>
  </ul>

</nav>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://github.com/13850554413/13850554413.github.io/2018/07/05/linux%E7%AE%80%E8%AE%B0/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="小灰灰">
      <meta itemprop="description" content="我的博客用于记录">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="天上人间">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          linux笔记
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2018-07-05 15:30:16" itemprop="dateCreated datePublished" datetime="2018-07-05T15:30:16+08:00">2018-07-05</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-02-18 20:44:30" itemprop="dateModified" datetime="2020-02-18T20:44:30+08:00">2020-02-18</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/linux-%E7%AC%94%E8%AE%B0/" itemprop="url" rel="index">
                    <span itemprop="name">linux,笔记</span>
                  </a>
                </span>
            </span>

          
            <div class="post-description">linux命令这么多我该怎么记-如何查找Linux的命令</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p><strong>linux命令这么多我该怎么记-如何查找Linux的命令</strong><br><a href="https://linux.cn/lfs/LFS-BOOK-7.7-systemd/index.html" target="_blank" rel="noopener">https://linux.cn/lfs/LFS-BOOK-7.7-systemd/index.html</a></p>
<p><em>find        查找</em></p>
<blockquote>
<p>-name         名称<br>  -maxdepth     递归层级(大)<br>  -mindepth     递归层级(小)<br>  -user         用户<br>  -group        属组<br>  -perm         权限<br>  -not          非(-not -user [name] #不是name用户,group等也可以组合)<br>  -exec         后接要执行的命令(-exec chmod o-w # 根据查找到的文件将其他人的权限改为不可写)  </p>
</blockquote>
<pre><code>free -m     查看内存的使用
uname -a    查看内核版本
locate      简单的查找文件
ldd     查看命令依赖
whereis     程序名搜索-b二进制文件-m man说明文件 -s源代码文件
which       搜索命令位置
nl          查看文件内容会显示行号
wc          统计文件信息
type        查看是不是shell自带命令
history     查看最近的所有命令可以陪grep使用，效果更好
whoami      查看当前用户
useradd     创建用户
chmod       权限操作
chown       修改文件所有者(属主)
alias       取别名
df -h       显示已经挂载的分区列表
du -sh      查看目录占用空间
du -h       查看文件大小
sed &apos;s/stringa1/stringa2/g&apos; example.txt 替换命令，将example.txt文件中的 &quot;string1&quot; 替换成 &quot;string2&quot;
dump -0aj -f /tmp/home0.bak /home 制作一个 &apos;/home&apos; 目录的完整备份
nohup       使用nohup在登出ssh会话后仍继续运行命令
ranger      文件浏览
lsblk    查看磁盘挂载</code></pre><p><strong>进程管理</strong></p>
<pre><code>kill pid    杀掉进程</code></pre><p><strong>暂停并在后台运行命令</strong></p>
<pre><code>ctrl + z    暂停应用程序
bg          让其在后台运行
fg          重新将运用程序唤到前台</code></pre><p><strong>linux命令行快捷键</strong></p>
<pre><code>ctrl + u    剪切光标前的内容
ctrl + k    剪切光标至行未的内容
crrl + y    粘帖
ctrl + e    移动光标至行抹
ctrl + a    移动光标到行首
alt  + f    跳到下一个空格
alt  + b    跳到上一个空格
alt  + Backspace  删除前一个单词
ctrl + w    剪切光标前一个单词
ctrl + l    清屏
stty + a    打印或查看控制字符(ctrl-c, ctrl-d, ctrl-z等)
^a^b^       替换上一个命令a变成b(命令输错可用)</code></pre><p><strong>命令复用</strong></p>
<pre><code>!!          重复上一条命令
c         重复上一条以ec开头的命令
!76         用命令历史(history)中的76号命令</code></pre><p><strong>{}()语法</strong></p>
<pre><code>touch name{1..10}.text
$(cmd)  #执行cmd在替换原来的命令
()  # 命令组括号中的命令会在开一个子shell执行</code></pre>
    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/linux/" rel="tag"># linux</a>
              <a href="/tags/%E7%AC%94%E8%AE%B0/" rel="tag"># 笔记</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2018/07/05/%E7%88%AC%E8%99%AB%E6%A1%86%E6%9E%B6%E6%80%9D%E8%80%83/" rel="prev" title="爬虫框架思考">
      <i class="fa fa-chevron-left"></i> 爬虫框架思考
    </a></div>
      <div class="post-nav-item">
    <a href="/2018/10/07/git%E7%AE%80%E8%AE%B0/" rel="next" title="git笔记">
      git笔记 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let activeClass = CONFIG.comments.activeClass;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">小灰灰</p>
  <div class="site-description" itemprop="description">我的博客用于记录</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">10</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">6</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">10</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/yourname" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;yourname"><i class="fa fa-fw fa-github"></i>GitHub</a>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title">
      <i class="fa fa-fw fa-link"></i>
      友情链接
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="http://yoursite.com/" title="http:&#x2F;&#x2F;yoursite.com" rel="noopener" target="_blank">链接1</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="http://yoursite.com/" title="http:&#x2F;&#x2F;yoursite.com" rel="noopener" target="_blank">链接2</a>
        </li>
    </ul>
  </div>

      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">小灰灰</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v4.2.0
  </div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">主题 – <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> v7.7.1
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
